﻿using System.Collections.Generic;
using System.Windows.Controls;

namespace bitMail.Class
{
    internal class CoreRepository
    {
        public List<DataGridRow> GetDataGridRows(DataGrid grid)
        {
            var result = new List<DataGridRow>();
            for (var i = 0; i < grid.Items.Count; i++)
            {
                grid.UpdateLayout();
                grid.ScrollIntoView(grid.Items[i]);
                var row = (DataGridRow)grid.ItemContainerGenerator
                    .ContainerFromIndex(i);
                result.Add(row);
            }
            return result;
        }
    }
}
